#include<iostream>
#include<string>
using namespace std;

int main()
{
    string A, B;
    getline(cin,A);
    getline(cin,B);
    for (int i = 0; i < A.size(); )
    {
        if (B.size() == 0)
            break;
        for (int j = 0; j < B.size(); j++)
        {
            if (A[i] == B[j])
            {
                A.erase(A.begin() + i);
                i--;
                break;
            }
        }
        i++;
    }

    for (int i = 0; i < A.size(); i++)
        cout << A[i];
    cout << endl;
    return 0;
}